<!doctype html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="registrationsTitle" value="${retreat?.name ?: 'Unknown Camp'} Registrations" />
		<title>${registrationsTitle}</title>
	</head>
	<body>
		<div class="content" role="main">
			<h1>${registrationsTitle} (${registrations.size()})</h1>
			<g:if test="${flash.message}">
				<div class="message" role="status">${flash.message}</div>
			</g:if>
			<table>
				<thead>
					<tr>
						<g:sortableColumn property="dateCreated" width="25%" title="${message(code: 'registration.dateCreated.label', default: 'Date Created')}" />
						<g:sortableColumn property="profile" width="25%" title="${message(code: 'registration.profile.label', default: 'Name')}" />
						<g:sortableColumn property="completed" width="15%" title="${message(code: 'registration.completed.label', default: 'Completed')}" />
						<g:sortableColumn property="notes" title="${message(code: 'registration.notes.label', default: 'Notes')}" />
					</tr>
				</thead>
				<tbody>
				<g:each in="${registrations}" status="i" var="registration">
					<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
						<td>
							<g:link action="register" id="${retreat.id}" params="${[registrationId:registration.id]}">
								<putils:formatDate date="${registration.dateCreated}" />
							</g:link>
						</td>
						<td><g:link controller="profile" action="show" id="${registration.profile.id}">${registration.profile}</g:link></td>
						<td class="center">${registration.completed ? 'Yes' : 'No' }
						<td><putils:truncate value="${registration.notes}" maxlength="255" /></td>
					</tr>
				</g:each>
				</tbody>
			</table>
			<%--
			<div class="pagination">
				<g:paginate action="registrations" total="${registrations.size()}" />
			</div>
			 --%>
		</div>
	</body>
</html>
